home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / sox.zip / COPY.C < prev    next >
C/C++ Source or Header  |  1992-06-15  |  1KB  |  71 lines

  1. /*
  2.  * July 5, 1991
  3.  * Copyright 1991 Lance Norskog And Sundry Contributors
  4.  * This source code is freely redistributable and may be used for
  5.  * any purpose.  This copyright notice must be maintained. 
  6.  * Lance Norskog And Sundry Contributors are not responsible for 
  7.  * the consequences of using this software.
  8.  */
  9.  
  10. /*
  11.  * Sound Tools skeleton effect file.
  12.  */
  13.  
  14. #include "st.h"
  15.  
  16. /*
  17.  * Process options
  18.  */
  19. copy_getopts(effp, n, argv) 
  20. eff_t effp;
  21. int n;
  22. char **argv;
  23. {
  24.     if (n)
  25.         fail("Copy effect takes no options.");
  26. }
  27.  
  28. /*
  29.  * Start processing
  30.  */
  31. copy_start(effp)
  32. eff_t effp;
  33. {
  34.     /* nothing to do */
  35.     /* stuff data into delaying effects here */
  36. }
  37.  
  38. /*
  39.  * Read up to len samples from file.
  40.  * Convert to signed longs.
  41.  * Place in buf[].
  42.  * Return number of samples read.
  43.  */
  44.  
  45. copy_flow(effp, ibuf, obuf, isamp, osamp)
  46. eff_t effp;
  47. long *ibuf, *obuf;
  48. int *isamp, *osamp;
  49. {
  50.     int done;
  51.     
  52.     done = ((*isamp < *osamp) ? *isamp : *osamp);
  53.     bcopy(ibuf, obuf, done * sizeof(long));
  54.     *isamp = *osamp = done;
  55.     return done;
  56. }
  57.  
  58. /*
  59.  * Do anything required when you stop reading samples.  
  60.  * Don't close input file! 
  61.  */
  62. copy_stop(effp)
  63. eff_t effp;
  64. {
  65.     /* nothing to do */
  66. }
  67.  
  68.  
  69.  
  70.  
  71.